<div class="content-section introduction">
    <div class="feature-intro">
        <h1>Badge</h1>
        <p>Badge is a small status indicator for another element.</p>
    </div>
    <app-demoActions github="badge" stackblitz="badge-demo"></app-demoActions>
</div>

<div class="content-section implementation">
    <div class="card">
        <h5>Numbers</h5>
        <div class="badges">
            <p-badge [value]="2" styleClass="mr-2"></p-badge>
            <p-badge [value]="8" severity="success" styleClass="mr-2"></p-badge>
            <p-badge [value]="4" severity="info" styleClass="mr-2"></p-badge>
            <p-badge [value]="12" severity="warning" styleClass="mr-2"></p-badge>
            <p-badge [value]="3" severity="danger"></p-badge>
        </div>

        <h5>Positioned Badge</h5>
        <i class="pi pi-bell mr-4 p-text-secondary" pBadge style="font-size: 2rem" value="2"></i>
        <i class="pi pi-calendar mr-4 p-text-secondary" pBadge style="font-size: 2rem" [value]="'10+'" severity="danger"></i>
        <i class="pi pi-envelope p-text-secondary" pBadge style="font-size: 2rem" severity="danger"></i>

        <h5>Inline Button Badge</h5>
        <p-button label="Emails" badge="8" styleClass="mr-2"></p-button>
        <p-button label="Messages" icon="pi pi-users" styleClass="p-button-warning" badge="8" badgeClass="p-badge-danger"></p-button>

        <h5>Sizes</h5>
        <div class="badges">
            <p-badge [value]="2" styleClass="mr-2"></p-badge>
            <p-badge [value]="4" size="large" severity="warning" styleClass="mr-2"></p-badge>
            <p-badge [value]="6" size="xlarge" severity="success" styleClass="mr-2"></p-badge>
        </div>
    </div>
</div>

<div class="content-section documentation">
    <p-tabView>
        <p-tabPanel header="Documentation">
            
            <h5>Getting Started</h5>
            <p>Badge can either be used as a standalone component or as a directive.</p>

<app-code lang="typescript" ngNonBindable ngPreserveWhitespaces>
import &#123;BadgeModule&#125; from 'primeng/badge';
</app-code>
            <h6>Component</h6>
            <p>Content of the badge is specified using the <i>value</i> property.</p>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-badge [value]="2"&gt;&lt;/p-badge&gt;
</app-code>

            <h6>Directive</h6>
            <p>Content of the badge is specified using the <i>value</i> property.</p>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;i class="pi pi-bell" pBadge value="2"&gt;&lt;/i&gt;
</app-code>

            <h5>Severities</h5>
            <p>Different color options are available as severity levels. When used as a component use the <i>severity</i> property
            to apply a severity and use a <i>modifier</i> as the severity value in directive mode.</p>

            <ul>
                <li>success</li>
                <li>info</li>
                <li>warning</li>
                <li>danger</li>
            </ul>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-badge [value]="2"  severity="success"  severity="success"&gt;&lt;/p-badge&gt;

&lt;i class="pi pi-bell" pBadge value="2"  severity="success"&gt;&lt;/i&gt;
</app-code>

            <h5>Button Badges</h5>
            <p>Buttons provide integrated badge support with the <i>badge</i> and <i>badgeClass</i> properties.
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-button label="Emails" badge="8" styleClass="mr-2"&gt;&lt;/p-button&gt;
&lt;p-button label="Messages" icon="pi pi-users" styleClass="p-button-warning" badge="8" badgeClass="p-badge-danger"&gt;&lt;/p-button&gt;
</app-code>

            <h5>Sizes</h5>
            <p>Badge sizes are adjusted with the <i>size</i> property that accepts "large" and "xlarge" as the possible alternatives to the default size. Currently
                sizes only apply to component mode.</p>
<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-badge value="2"&gt;&lt;/p-badge&gt;
&lt;p-badge value="4" size="large" severity="warning"&gt;&lt;/p-badge&gt;
&lt;p-badge value="6" size="xlarge" severity="success"&gt;&lt;/p-badge&gt;
</app-code>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;h1&gt;Heading 1 &lt;p-badge value="New"&gt;&lt;/p-badge&gt;&lt;/h1&gt;
&lt;h2&gt;Heading 2 &lt;p-badge value="New"&gt;&lt;/p-badge&gt;&lt;/h2&gt;
</app-code>

            <h5>Properties</h5>
				<p>Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.</p>
				<div class="doc-tablewrapper">
					<table class="doc-table">
						<thead>
                            <tr>
                                <th>Name</th>
                                <th>Type</th>
                                <th>Default</th>
                                <th>Description</th>
                            </tr>
						</thead>
						<tbody>
                            <tr>
                                <td>value</td>
                                <td>any</td>
                                <td>null</td>
                                <td>Value to display inside the badge.</td>
                            </tr>
							<tr>
                                <td>severity</td>
                                <td>string</td>
                                <td>null</td>
                                <td>Severity type of the badge.</td>
                            </tr>
							<tr>
                                <td>size</td>
                                <td>string</td>
                                <td>null</td>
                                <td>Size of the badge, valid options are "large" and "xlarge".</td>
                            </tr>
                            <tr>
                                <td>style</td>
                                <td>object</td>
                                <td>null</td>
                                <td>Inline style of the component.</td>
                            </tr>
                            <tr>
                                <td>styleClass</td>
                                <td>string</td>
                                <td>null</td>
                                <td>Style class of the component.</td>
                            </tr>
						</tbody>
					</table>
				</div>

            <h5>Styling</h5>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming</a> page.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                    <tr>
                        <th>Name</th>
                        <th>Element</th>
                    </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>p-badge</td>
                            <td>Badge element</td>
                        </tr>
                        <tr>
                            <td>p-overlay-badge</td>
                            <td>Wrapper of a badge and its target.</td>
                        </tr>
                        <tr>
                            <td>p-badge-dot</td>
                            <td>Badge element with no value.</td>
                        </tr>
                        <tr>
                            <td>p-badge-success</td>
                            <td>Badge element with success severity.</td>
                        </tr>
                        <tr>
                            <td>p-badge-info</td>
                            <td>Badge element with info severity.</td>
                        </tr>
                        <tr>
                            <td>p-badge-warning</td>
                            <td>Badge element with warning severity.</td>
                        </tr>
                        <tr>
                            <td>p-badge-danger</td>
                            <td>Badge element with danger severity.</td>
                        </tr>
                        <tr>
                            <td>p-badge-lg</td>
                            <td>Large badge element</td>
                        </tr>
                        <tr>
                            <td>p-badge-xl</td>
                            <td>Extra large badge element</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h5>Dependencies</h5>
            <p>None.</p>
        </p-tabPanel>

        <p-tabPanel header="Source">
            <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/badge" class="btn-viewsource" target="_blank">
                <span>View on GitHub</span>
            </a>
            <a href="https://stackblitz.com/edit/primeng-badge-demo" class="btn-viewsource" style="margin-left: .5em;" target="_blank">
                <span>Edit in StackBlitz</span>
            </a>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;h5&gt;Numbers&lt;/h5&gt;
&lt;div class="badges"&gt;
    &lt;p-badge [value]="2" styleClass="mr-2"&gt;&lt;/p-badge&gt;
    &lt;p-badge [value]="8" severity="success" styleClass="mr-2"&gt;&lt;/p-badge&gt;
    &lt;p-badge [value]="4" severity="info" styleClass="mr-2"&gt;&lt;/p-badge&gt;
    &lt;p-badge [value]="12" severity="warning" styleClass="mr-2"&gt;&lt;/p-badge&gt;
    &lt;p-badge [value]="3" severity="danger"&gt;&lt;/p-badge&gt;
&lt;/div&gt;

&lt;h5&gt;Positioned Badge&lt;/h5&gt;
&lt;i class="pi pi-bell mr-4 p-text-secondary" pBadge style="font-size: 2rem" value="2"&gt;&lt;/i&gt;
&lt;i class="pi pi-calendar mr-4 p-text-secondary" pBadge style="font-size: 2rem" [value]="'10+'" severity="danger"&gt;&lt;/i&gt;
&lt;i class="pi pi-envelope p-text-secondary" pBadge style="font-size: 2rem" severity="danger"&gt;&lt;/i&gt;


&lt;h5&gt;Inline Button Badge&lt;/h5&gt;
&lt;p-button label="Emails" badge="8" styleClass="mr-2"&gt;&lt;/p-button&gt;
&lt;p-button label="Messages" icon="pi pi-users" styleClass="p-button-warning" badge="8" badgeClass="p-badge-danger"&gt;&lt;/p-button&gt;

&lt;h5&gt;Sizes&lt;/h5&gt;
&lt;div class="badges"&gt;
    &lt;p-badge [value]="2" styleClass="mr-2"&gt;&lt;/p-badge&gt;
    &lt;p-badge [value]="4" size="large" severity="warning" styleClass="mr-2"&gt;&lt;/p-badge&gt;
    &lt;p-badge [value]="6" size="xlarge" severity="success" styleClass="mr-2"&gt;&lt;/p-badge&gt;
&lt;/div&gt;
</app-code>
        </p-tabPanel>
        <p-tabPanel header="StackBlitz">
            <ng-template pTemplate="content">
                <iframe src="https://stackblitz.com/edit/primeng-badge-demo?embed=1" style="width: 100%; height: 768px; border: none;"></iframe>
            </ng-template>
        </p-tabPanel>
    </p-tabView>
</div>